package com.yfp.operation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yfp.operation.domain.DeviceComboPlanNumDO;
import com.yfp.operation.domain.dto.ComboSalesDO;
import com.yfp.operation.domain.dto.ComboSalesDTO;
import com.yfp.operation.domain.dto.ComboSalesPositionDTO;
import com.yfp.operation.domain.vo.ComboSaleDataVO;
import com.yfp.operation.domain.vo.ComboSalesPositionVO;
import com.yfp.operation.domain.vo.PlanNumVO;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
* @author admin
* @description 针对表【device_combo_plan_count】的数据库操作Mapper
* @createDate 2024-05-14 14:21:56
* @Entity com.yfp.operation.domain.DeviceComboPlanCount
*/
public interface DeviceComboPlanNumMapper extends BaseMapper<DeviceComboPlanNumDO> {

    void updateCount(DeviceComboPlanNumDO countDO);

    Integer getByMachineId(String machineId);

    void batchUpdate(@Param("dcpnList") ArrayList<DeviceComboPlanNumDO> dcpnList);

    List<PlanNumVO> getAll(String machineId);

    void insertAll(@Param("deviceComboPlanNumDOS") ArrayList<DeviceComboPlanNumDO> deviceComboPlanNumDOS);

    void deleteByMachineId(String machineId);

    /**
     * 获取投放记录
     * @param machineId
     * @return
     */
    List<DeviceComboPlanNumDO> getByMacineId(@Param("machineId") String machineId);

    /**
     *
     * @param machineId
     * @return
     */
    List<String> getCPlanComboIds(String machineId);

    /**
     * 获取当天投放记录的最后条数据
     * @param machineId
     * @return
     */
    DeviceComboPlanNumDO getDayByMacineId(String machineId);

    /**
     * 获取当天投放记录的第一条数据
     * @param machineId
     * @return
     */
    DeviceComboPlanNumDO getDayFirstByMacineId(String machineId);

    /**
     * 投放量
     *
     * @param list
     * @return
     */
    List<DeviceComboPlanNumDO> getCreateTime(@Param("list") List<ComboSaleDataVO> list, @Param("startTime") Date startTime, @Param("endTime") Date endTime,@Param("machineId") String machineId);

    List<ComboSalesDO> getComboSalesList(ComboSalesDTO comboSalesDTO);

    List<ComboSalesPositionVO> getComboSalesPositionList(ComboSalesPositionDTO comboSalesDTO);

    List<DeviceComboPlanNumDO> getComboNum(@Param("createTimeDOS") List<DeviceComboPlanNumDO> createTimeDOS);

    List<ComboSaleDataVO> grantDate(@Param("machineIds") List<String> machineIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<ComboSaleDataVO> grantNum(@Param("grantDateList") List<ComboSaleDataVO> grantDateList);
}




